<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <button v-on:click="msg='值修改了'">按钮</button>
    {{ msg }}
    <hr>
    <!-- 绑定事件函数 -->
    <button v-on:click="changeMsg">按钮</button>
    <!-- 绑定事件函数并传参 -->
    <hr>
    <button v-on:click="changeNum(10000)">按钮</button>
    {{ num }}
    <!-- 简写 @事件名 -->
    <hr>
    <button @click="changeNum(10000)">按钮</button>
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp({
      data(){
        return {
          msg:'hello vue3',
          num: 10
        }
      },
      methods: {
        changeMsg(){
          this.msg = '这里也可以修改值'
        },
        changeNum(n){
          this.num = n;
        }
      }
    })
    // 实例渲染
    app.mount('#app');
  </script>
</body>
</html>